/*
 * Copyright 2018 JDCLOUD.COM
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http:#www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * 
 * 
 *
 * 
 * Contact: 
 *
 * NOTE: This class is auto generated by the jdcloud code generator program.
 */


using System;
using System.Collections.Generic;
using System.Text;

using JDCloudSDK.Core.Annotation;

namespace JDCloudSDK.Ipanti.Model
{

    /// <summary>
    ///  webRuleSpec
    /// </summary>
    public class WebRuleSpec
    {

        ///<summary>
        /// 高防 IP, serviceIps 为空时生效
        ///</summary>
        public string ServiceIp{ get; set; }
        ///<summary>
        /// 高防 IP 列表, 不为空时忽略 serviceIp, 传多个时后台会在高防IP封禁后随机切换其他未封禁的IP
        ///</summary>
        public List<string> ServiceIps{ get; set; }
        ///<summary>
        /// 子域名
        ///Required:true
        ///</summary>
        [Required]
        public string Domain{ get; set; }
        ///<summary>
        /// 协议: http, https 至少一个为 true
        ///Required:true
        ///</summary>
        [Required]
        public WebRuleProtocol Protocol{ get; set; }
        ///<summary>
        /// HTTP 协议的端口号, 如80, 81; 如果 protocol.http 为 true, 至少配置一个端口
        ///</summary>
        public List<int?> Port{ get; set; }
        ///<summary>
        /// HTTPS 协议的端口号, 如443, 8443; 如果 protocol.https 为 true, 至少配置一个端口
        ///</summary>
        public List<int?> HttpsPort{ get; set; }
        ///<summary>
        /// 回源类型：A 或者 CNAME
        ///Required:true
        ///</summary>
        [Required]
        public string OriginType{ get; set; }
        ///<summary>
        /// originType 为 A 时, 需要设置该字段
        ///</summary>
        public List<OriginAddrItem> OriginAddr{ get; set; }
        ///<summary>
        /// 备用的回源地址列表, 可以配置为一个域名或者多个 ip 地址
        ///</summary>
        public List<string> OnlineAddr{ get; set; }
        ///<summary>
        /// 回源域名, originType 为 CNAME 时需要指定该字段
        ///</summary>
        public string OriginDomain{ get; set; }
        ///<summary>
        /// 转发规则. &lt;br&gt;- wrr: 带权重的轮询&lt;br&gt;- rr:  不带权重的轮询&lt;br&gt;- sh:  源地址hash
        ///Required:true
        ///</summary>
        [Required]
        public string Algorithm{ get; set; }
        ///<summary>
        /// 是否开启 HTTPS 强制跳转, protocol.http 和 protocol.https 都为 true 时此参数生效. &lt;br&gt;- 0: 不开启强制跳转. &lt;br&gt;- 1: 开启强制跳转
        ///</summary>
        public int? ForceJump{ get; set; }
        ///<summary>
        /// 是否为自定义端口号. 0: 默认&lt;br&gt;- 1: 自定义
        ///</summary>
        public int? CustomPortStatus{ get; set; }
        ///<summary>
        /// 是否开启 HTTP 回源, protocol.https 为 true 时此参数生效. &lt;br&gt;- 0: 不开启. &lt;br&gt;- 1: 开启
        ///</summary>
        public int? HttpOrigin{ get; set; }
        ///<summary>
        /// 是否开启 WebSocket.&lt;br&gt;- 0: 不开启&lt;br&gt;- 1: 开启
        ///Required:true
        ///</summary>
        [Required]
        public int WebSocketStatus{ get; set; }
        ///<summary>
        /// 按区域分流回源配置
        ///</summary>
        public List<GeoRsRoute> GeoRsRoute{ get; set; }
        ///<summary>
        /// 是否开启回源长连接, protocol 选项开启 https 时生效, 可取值&lt;br&gt;- on: 开启&lt;br&gt;- off: 关闭
        ///</summary>
        public string EnableKeepalive{ get; set; }
        ///<summary>
        /// http 版本, protocol 选项开启 https 时生效, 可取值 http1 或 http2
        ///</summary>
        public string HttpVersion{ get; set; }
        ///<summary>
        /// SSL协议类型, protocol 选项开启 https 时生效, 可取值SSLv2,SSLv3,TLSv1.0,TLSv1.1,TLSv1.2
        ///</summary>
        public List<string> SslProtocols{ get; set; }
        ///<summary>
        /// 加密套件等级, protocol 选项开启 https 时生效, 可取值&lt;br&gt;- low: 低级&lt;br&gt;- middle: 中级&lt;br&gt;- high：高级&lt;br&gt;- custom：自定义
        ///</summary>
        public string SuiteLevel{ get; set; }
        ///<summary>
        /// 自定义加密套件等级, suiteLevel 为 custom 是有效
        ///</summary>
        public List<string> UserSuiteLevel{ get; set; }
        ///<summary>
        /// 健康检查开关, 0: 关闭, 1: 开启
        ///</summary>
        public int? EnableHealthCheck{ get; set; }
        ///<summary>
        /// 回源连接超时时长, 单位 秒
        ///</summary>
        public int? ProxyConnectTimeout{ get; set; }
        ///<summary>
        /// 请求头支持下划线, 0: 关闭, 1: 开启
        ///</summary>
        public int? EnableUnderscores{ get; set; }
    }
}
